import { createSlice } from "@reduxjs/toolkit"

export const userSlice = createSlice({
    name: "user",
    initialState: {
        name: "",
        count: 0,
    },
    reducers: {
        setName: (state, action) => {
            state.name = action.payload
        },
        setCount: (state, action) => {
            state.count = action.payload
        }
    }
})

export const { setName, setCount } = userSlice.actions
export default userSlice.reducer